class MyClass:
    i = 12345
    def f(self):
        return "hello world"
    def __init__(self):
        self.data = "dt"
        print "done";
    def __init__(self,real,img):
        self.r = real
        self.i = img

class Reverse:
    def __init__(self,data):
        self.data = data
        self.index= len(data)
    def __iter__(self):
        return self
    def next(self):
        if self.index == 0:
            raise StopIteration
        self.index = self.index -1
        return self.data[self.index]

def reverse(data):
    for index in range(len(data)-1,-1,-1):
        yield data[index]

rev = Reverse('spam')
for char in reverse("golf"):
    print char
